//
//  SearchPlaceTableViewCell.m
//  HappinessTrip
//
//  Created by dllo on 15/10/21.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "SearchPlaceTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "Fit.h"

@implementation SearchPlaceTableViewCell
-(void)dealloc
{
    [_ImageView release];
    [_label release];
    [_youImageView release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}
-(void)createViews
{
    _ImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:_ImageView];
    [_ImageView release];
    _label = [[UILabel alloc]init];
    [self.contentView addSubview:_label];
    [_label release];
    _youImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:_youImageView];
    [_youImageView release];
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _ImageView.frame = CGRectMake(10 * W, 5 * H, 30 * W, 30 * H);
    _label.frame = CGRectMake(_ImageView.frame.origin.x + _ImageView.frame.size.width + 10 * W, _ImageView.frame.origin.y, 100 * W, _ImageView.frame.size.height);
    _youImageView.frame = CGRectMake(330 * W, _label.frame.origin.y + 5 * H, 20 * W, 20 * H);
    
}
-(void)setSearch:(SearchPlace *)search
{
    if (_search != search) {
        [_search release];
        _search = [search retain];
    }
    [_ImageView sd_setImageWithURL:[NSURL URLWithString:_search.icon] placeholderImage:[UIImage imageNamed:@"dengdai"]];
    _label.text = _search.name;
    _youImageView.image = [UIImage imageNamed:@"xiangyou"];
}












- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
